//
//  Activity.m
//  newDouban
//
//  Created by dllo on 15/10/31.
//  Copyright © 2015年 蓝鸥科技. All rights reserved.
//

#import "Activity.h"

@implementation Activity


- (void)dealloc
{
    [_content release];
    [_name release];
    [_image release];
    [_address release];
    [_category_name release];
    [_begin_time release];
    [_end_time release];
    [_title release];
    [_wisher_countt release];
    [_participant_countt release];
    [super dealloc];
}



//2

- (void)encodeWithCoder:(NSCoder *)aCoder
{
    [aCoder encodeObject:self.content forKey:@"content"];
    [aCoder encodeObject:self.name forKey:@"name"];
    [aCoder encodeObject:self.image forKey:@"image"];
    [aCoder encodeObject:self.address forKey:@"address"];
    [aCoder encodeObject:self.category_name forKey:@"category_name"];
    [aCoder encodeObject:self.begin_time forKey:@"begin_time"];
    [aCoder encodeObject:self.end_time forKey:@"end_time"];
    [aCoder encodeObject:self.title forKey:@"title"];
    [aCoder encodeObject:self.wisher_countt forKey:@"wisher_count"];
    [aCoder encodeObject:self.participant_countt forKey:@"participant_count"];
}

//3
- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
    self = [super init];
    if (self) {
        self.content = [aDecoder decodeObjectForKey:@"content"];
        self.name = [aDecoder decodeObjectForKey:@"name"];
        self.image = [aDecoder decodeObjectForKey:@"image"];
        self.address = [aDecoder decodeObjectForKey:@"address"];
        self.category_name = [aDecoder decodeObjectForKey:@"content"];
        self.begin_time = [aDecoder decodeObjectForKey:@"begin_time"];
        self.end_time = [aDecoder decodeObjectForKey:@"end_time"];
        self.title = [aDecoder decodeObjectForKey:@"title"];
        self.wisher_countt = [aDecoder decodeObjectForKey:@"wisher_count"];
        self.participant_countt = [aDecoder decodeObjectForKey:@"participant_count"];
    }
    return self;
}






- (void)setValue:(id)value forKey:(NSString *)key
{
    [super setValue:value forKey:key];
    
    //    if ([key isEqualToString:@"wisher_count"]) {
    //        self
    //    }
}


- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    if ([key isEqualToString:@"wisher_count"]) {
        self.wisher_countt = [NSString stringWithFormat:@"%@", value];
    }
    if ([key isEqualToString:@"participant_count"]) {
        self.participant_countt = [NSString stringWithFormat:@"%@", value];
    }
    
    
}




@end
